package net.tngou.crawler.company;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.io.FileUtils;

import net.tngou.crawler.util.ConfigurationUtil;

public class CityCode {

	
	public static Map<String, String> map() {
		Map<String, String> map = new HashMap<>();
		File file = ConfigurationUtil.file("cityCode.txt");

		try {
			List<String> list= FileUtils.readLines(file);
			list.forEach(e->{
				String[] ps = e.split(",");
				if(ps.length==2)
					map.put(ps[0], ps[1]);
			});
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return map;
		
	}
	
	public static void main(String[] args) throws IOException {
		System.err.println(map().get("48"));
	}
}
